#ifndef HISTORYWIDGET_H
#define HISTORYWIDGET_H
//
#include <QWidget>
#include <QSettings>
#include "ui_historyWidget.h"
#include "ui_showLinks.h"
#include "DataStructures.h"
//
class historyWidget : public QWidget
{
	Q_OBJECT
	Q_PROPERTY(bool selected READ selected WRITE select);
	Q_PROPERTY(QString resultText READ resultText);
public:
#ifdef NOPREVIEW
	historyWidget(const QString &title, const UploadResult &textResults);
#else
	historyWidget(const QPixmap &preview, const QString &title, const UploadResult &textResults);
#endif
	inline bool selected() const { return ui.checkBox->isChecked(); }
	inline void unSelect() { select(false); }
	inline void select(const bool selected = true) { ui.checkBox->setChecked(selected); }
	inline UploadResult links() const { return linkStructure; }
	static QString resultText(const UploadResult &links, QString resTemplate, const bool html);
	QString resultText(bool html = false);
private:
	Ui::historyWidget ui;
	const UploadResult linkStructure;
	Ui::showLinks sl;
	QWidget showLinks;
	QSettings Config;
protected:
	void mouseDoubleClickEvent(QMouseEvent *event); // open ImageLinks
private slots:
};




#endif
